package com.tiendung.otalunch;

import java.util.ArrayList;
import java.util.HashMap;

public class Restaurant {
	private static ArrayList<HashMap<String, String>> restaurant_detail = new ArrayList<HashMap<String, String>>();
	
	static {
		HashMap<String, String> hm = new HashMap<String, String>();
		hm.put("name", "Dipoli");
		hm.put("address", "Otakaari 24, 02150 Espoo, Finland");
		hm.put("lat", "60.18542");
		hm.put("long", "24.831178");
		hm.put("Monday", "10.30-15.00"); hm.put("Tuesday", "10.30-15.00"); hm.put("Wednesday", "10.30-15.00"); 
		hm.put("Thursday", "10.30-15.00"); hm.put("Friday", "10.30-15.00"); hm.put("Saturday", "Closed"); 		
		restaurant_detail.add(hm);
		
		hm = new HashMap<String, String>();
		hm.put("name", "Electrical Engineering");
		hm.put("address", "Otakaari 5, 02150 Espoo, Finland");
		hm.put("lat", "60.188951");
		hm.put("long", "24.830132");
		hm.put("Monday", "10.30-14.00"); hm.put("Tuesday", "10.30-14.00"); hm.put("Wednesday", "10.30-14.00"); 
		hm.put("Thursday", "10.30-14.00"); hm.put("Friday", "10.30-14.00"); hm.put("Saturday", "Closed"); 		
		restaurant_detail.add(hm);

		hm = new HashMap<String, String>();
		hm.put("name", "CSE Building");
		hm.put("address", "Konemiehentie 2, Espoo, Finland");
		hm.put("lat", "60.187372");
		hm.put("long", "24.822353");
		hm.put("Monday", "10.30-14.30"); hm.put("Tuesday", "10.30-14.30"); hm.put("Wednesday", "10.30-14.30"); 
		hm.put("Thursday", "10.30-14.30"); hm.put("Friday", "10.30-14.30"); hm.put("Saturday", "Closed"); 		
		restaurant_detail.add(hm);
		
		hm = new HashMap<String, String>();
		hm.put("name", "Restaurant Kasper");
		hm.put("address", "Bergsman 2, Espoo, Finland");
		hm.put("lat", "60.183035");
		hm.put("long", "24.826355");
		hm.put("Monday", "10.30-14.00"); hm.put("Tuesday", "10.30-14.00"); hm.put("Wednesday", "10.30-14.00"); 
		hm.put("Thursday", "10.30-14.00"); hm.put("Friday", "10.30-14.00"); hm.put("Saturday", "Closed"); 		
		restaurant_detail.add(hm);
		
		hm = new HashMap<String, String>();
		hm.put("name", "Mechanical Engineering");
		hm.put("address", "Otakaari 4, Espoo, Finland");
		hm.put("lat", "60.186801");
		hm.put("long", "24.826956");
		hm.put("Monday", "10.30-13.30"); hm.put("Tuesday", "10.30-13.30"); hm.put("Wednesday", "10.30-13.30"); 
		hm.put("Thursday", "10.30-13.30"); hm.put("Friday", "10.30-13.30"); hm.put("Saturday", "Closed"); 		
		restaurant_detail.add(hm);

		hm = new HashMap<String, String>();
		hm.put("name", "Restaurant Kvarkki");
		hm.put("address", "Otakaari 3, Espoo, Finland");
		hm.put("lat", "60.188481");
		hm.put("long", "24.82922");
		hm.put("Monday", "10.30-14.00"); hm.put("Tuesday", "10.30-14.00"); hm.put("Wednesday", "10.30-14.00"); 
		hm.put("Thursday", "10.30-14.00"); hm.put("Friday", "10.30-13.00"); hm.put("Saturday", "Closed"); 		
		restaurant_detail.add(hm);
		
		hm = new HashMap<String, String>();
		hm.put("name", "Restaurant Alvari");
		hm.put("address", "Otakaari 1D, Espoo, Finland");
		hm.put("lat", "60.186833");
		hm.put("long", "24.827031");
		hm.put("Monday", "10.30-14.00"); hm.put("Tuesday", "10.30-14.00"); hm.put("Wednesday", "10.30-14.00"); 
		hm.put("Thursday", "10.30-14.00"); hm.put("Friday", "10.30-14.00"); hm.put("Saturday", "Closed"); 		
		restaurant_detail.add(hm);
		
		hm = new HashMap<String, String>();
		hm.put("name", "TUAS Building");
		hm.put("address", "Konemiehentie 2, Espoo, Finland");
		hm.put("lat", "60.186668");
		hm.put("long", "24.821033");
		hm.put("Monday", "10.30-15.00"); hm.put("Tuesday", "10.30-15.00"); hm.put("Wednesday", "10.30-15.00"); 
		hm.put("Thursday", "10.30-15.00"); hm.put("Friday", "10.30-14.30"); hm.put("Saturday", "Closed"); 		
		restaurant_detail.add(hm);
		
		hm = new HashMap<String, String>();
		hm.put("name", "TKK Puu2");
		hm.put("address", "Tekniikantie 3, Espoo, Finland");
		hm.put("lat", "60.180282");
		hm.put("long", "24.824982");
		hm.put("Monday", "10.30-13.30"); hm.put("Tuesday", "10.30-13.30"); hm.put("Wednesday", "10.30-13.30"); 
		hm.put("Thursday", "10.30-13.30"); hm.put("Friday", "10.30-13.30"); hm.put("Saturday", "Closed"); 		
		restaurant_detail.add(hm);
		
		hm = new HashMap<String, String>();
		hm.put("name", "Taffa");
		hm.put("address", "Otakaari 22, 02150 Espoo, Finland");
		hm.put("lat", "60.186321");
		hm.put("long", "24.832406");
		hm.put("Monday", "10:30-16:00"); hm.put("Tuesday", "10:30-16:00"); hm.put("Wednesday", "10:30-16:00"); 
		hm.put("Thursday", "10:30-16:00"); hm.put("Friday", "10:30-15:00"); hm.put("Saturday", "Closed"); 		
		restaurant_detail.add(hm);
			
	}
	
	public static String getAddress(String name)
	{
		for (int i = 0; i < restaurant_detail.size(); i++)
			if (restaurant_detail.get(i).get("name").equals(name.trim()))
				return restaurant_detail.get(i).get("address");				
		
		return null;
	}
	

	public static String getLat(String name)
	{
		for (int i = 0; i < restaurant_detail.size(); i++)
			if (restaurant_detail.get(i).get("name").equals(name.trim()))
				return restaurant_detail.get(i).get("lat");				
		
		return null;
	}
	

	public static String getLong(String name)
	{
		for (int i = 0; i < restaurant_detail.size(); i++)
			if (restaurant_detail.get(i).get("name").equals(name.trim()))
				return restaurant_detail.get(i).get("long");				
		
		return null;
	}
	
	public static String getOpenTime(String name, String day) {
		for (int i = 0; i < restaurant_detail.size(); i++)
			if (restaurant_detail.get(i).get("name").equals(name.trim()))
				return restaurant_detail.get(i).get(day);				
		
		return null;
	}
}
